package edu.guigu.networkdemomvvm;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import edu.guigu.networkdemomvvm.databinding.ActivityMainBinding;
import edu.guigu.networkdemomvvm.nonsingle.MultActivity;
import edu.guigu.networkdemomvvm.single.SingleViewActivity;

public class MainActivity extends AppCompatActivity {

    private ActivityMainBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        binding.button1.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, SingleViewActivity.class);
            startActivity(intent);
        });
        binding.button2.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, MultActivity.class);
            startActivity(intent);
        });
    }
}